#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <time.h>

int main(int argc, char *argv[])
{
    time_t now, cur;

    now = time(NULL);
    sleep(2);
    cur = time(NULL);
    printf("now:%ld - cur:%ld = %ld \n", now, cur, cur - now);

    return 0;
}
/*
now:1735113288 - cur:1735113290 = 2

结论:
time(NULL) 返回时间，精度是 秒/s
*/